
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module swmixer</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>swmixer</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/nwhitehe/Projects/pygalaxy/swmixer/swmixer.py">/home/nwhitehe/Projects/pygalaxy/swmixer/swmixer.py</a></font></td></tr></table>
    <p><tt>Advanced&nbsp;Realtime&nbsp;Software&nbsp;Mixer<br>
&nbsp;<br>
This&nbsp;module&nbsp;implements&nbsp;an&nbsp;advanced&nbsp;realtime&nbsp;sound&nbsp;mixer&nbsp;suitable&nbsp;for<br>
use&nbsp;in&nbsp;games&nbsp;or&nbsp;other&nbsp;audio&nbsp;applications.&nbsp;&nbsp;It&nbsp;supports&nbsp;loading&nbsp;sounds<br>
in&nbsp;uncompressed&nbsp;WAV&nbsp;format.&nbsp;&nbsp;It&nbsp;can&nbsp;mix&nbsp;several&nbsp;sounds&nbsp;together&nbsp;during<br>
playback.&nbsp;&nbsp;The&nbsp;volume&nbsp;and&nbsp;position&nbsp;of&nbsp;each&nbsp;sound&nbsp;can&nbsp;be&nbsp;finely<br>
controlled.&nbsp;&nbsp;The&nbsp;mixer&nbsp;can&nbsp;use&nbsp;a&nbsp;separate&nbsp;thread&nbsp;so&nbsp;clients&nbsp;never&nbsp;block<br>
during&nbsp;operations.&nbsp;&nbsp;Samples&nbsp;can&nbsp;also&nbsp;be&nbsp;looped&nbsp;any&nbsp;number&nbsp;of&nbsp;times.<br>
Looping&nbsp;is&nbsp;accurate&nbsp;down&nbsp;to&nbsp;a&nbsp;single&nbsp;sample,&nbsp;so&nbsp;well&nbsp;designed&nbsp;loops<br>
will&nbsp;play&nbsp;seamlessly.&nbsp;&nbsp;Also&nbsp;supports&nbsp;sound&nbsp;recording&nbsp;during&nbsp;playback.<br>
&nbsp;<br>
Copyright&nbsp;2008,&nbsp;Nathan&nbsp;Whitehead<br>
Released&nbsp;under&nbsp;the&nbsp;LGPL</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="mad.html">mad</a><br>
<a href="numpy.html">numpy</a><br>
</td><td width="25%" valign=top><a href="pyaudio.html">pyaudio</a><br>
<a href="thread.html">thread</a><br>
</td><td width="25%" valign=top><a href="time.html">time</a><br>
<a href="wave.html">wave</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="swmixer.html#Channel">Channel</a>
</font></dt><dt><font face="helvetica, arial"><a href="swmixer.html#Sound">Sound</a>
</font></dt><dt><font face="helvetica, arial"><a href="swmixer.html#StreamingSound">StreamingSound</a>
</font></dt></dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Channel">class <strong>Channel</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Represents&nbsp;one&nbsp;sound&nbsp;source&nbsp;currently&nbsp;playing<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Channel-__init__"><strong>__init__</strong></a>(self, src, env)</dt></dl>

<dl><dt><a name="Channel-fadeout"><strong>fadeout</strong></a>(self, time)</dt><dd><tt>Schedule&nbsp;a&nbsp;fadeout&nbsp;of&nbsp;this&nbsp;sound&nbsp;in&nbsp;given&nbsp;time</tt></dd></dl>

<dl><dt><a name="Channel-get_position"><strong>get_position</strong></a>(self)</dt><dd><tt>Return&nbsp;current&nbsp;position&nbsp;of&nbsp;sound&nbsp;in&nbsp;samples</tt></dd></dl>

<dl><dt><a name="Channel-get_volume"><strong>get_volume</strong></a>(self)</dt><dd><tt>Return&nbsp;current&nbsp;volume&nbsp;of&nbsp;sound</tt></dd></dl>

<dl><dt><a name="Channel-pause"><strong>pause</strong></a>(self)</dt><dd><tt>Pause&nbsp;the&nbsp;sound&nbsp;temporarily</tt></dd></dl>

<dl><dt><a name="Channel-set_position"><strong>set_position</strong></a>(self, p)</dt><dd><tt>Set&nbsp;current&nbsp;position&nbsp;of&nbsp;sound&nbsp;in&nbsp;samples</tt></dd></dl>

<dl><dt><a name="Channel-set_volume"><strong>set_volume</strong></a>(self, v, fadetime<font color="#909090">=0</font>)</dt><dd><tt>Set&nbsp;the&nbsp;volume&nbsp;of&nbsp;the&nbsp;sound<br>
&nbsp;<br>
Removes&nbsp;any&nbsp;previously&nbsp;set&nbsp;envelope&nbsp;information.&nbsp;&nbsp;Also<br>
overrides&nbsp;any&nbsp;pending&nbsp;fadeins&nbsp;or&nbsp;fadeouts.</tt></dd></dl>

<dl><dt><a name="Channel-stop"><strong>stop</strong></a>(self)</dt><dd><tt>Stop&nbsp;the&nbsp;sound&nbsp;playing</tt></dd></dl>

<dl><dt><a name="Channel-unpause"><strong>unpause</strong></a>(self)</dt><dd><tt>Unpause&nbsp;a&nbsp;previously&nbsp;paused&nbsp;sound</tt></dd></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Sound">class <strong>Sound</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Represents&nbsp;a&nbsp;playable&nbsp;sound<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Sound-__init__"><strong>__init__</strong></a>(self, filename<font color="#909090">=None</font>, data<font color="#909090">=None</font>)</dt><dd><tt>Create&nbsp;new&nbsp;sound&nbsp;from&nbsp;a&nbsp;WAV&nbsp;file,&nbsp;MP3&nbsp;file,&nbsp;or&nbsp;explicit&nbsp;sample&nbsp;data</tt></dd></dl>

<dl><dt><a name="Sound-get_length"><strong>get_length</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;length&nbsp;of&nbsp;the&nbsp;sound&nbsp;in&nbsp;samples<br>
&nbsp;<br>
To&nbsp;convert&nbsp;to&nbsp;seconds,&nbsp;divide&nbsp;by&nbsp;the&nbsp;samplerate&nbsp;and&nbsp;then&nbsp;divide<br>
by&nbsp;2&nbsp;if&nbsp;in&nbsp;stereo.</tt></dd></dl>

<dl><dt><a name="Sound-play"><strong>play</strong></a>(self, volume<font color="#909090">=1.0</font>, offset<font color="#909090">=0</font>, fadein<font color="#909090">=0</font>, envelope<font color="#909090">=None</font>, loops<font color="#909090">=0</font>)</dt><dd><tt>Play&nbsp;the&nbsp;sound<br>
&nbsp;<br>
Keyword&nbsp;arguments:<br>
volume&nbsp;-&nbsp;volume&nbsp;to&nbsp;play&nbsp;sound&nbsp;at<br>
offset&nbsp;-&nbsp;sample&nbsp;to&nbsp;start&nbsp;playback<br>
fadein&nbsp;-&nbsp;number&nbsp;of&nbsp;samples&nbsp;to&nbsp;slowly&nbsp;fade&nbsp;in&nbsp;volume<br>
envelope&nbsp;-&nbsp;a&nbsp;list&nbsp;of&nbsp;[offset,&nbsp;volume]&nbsp;pairs&nbsp;defining<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;linear&nbsp;volume&nbsp;envelope<br>
loops&nbsp;-&nbsp;how&nbsp;many&nbsp;times&nbsp;to&nbsp;play&nbsp;the&nbsp;sound&nbsp;(-1&nbsp;is&nbsp;infinite)</tt></dd></dl>

<dl><dt><a name="Sound-resample"><strong>resample</strong></a>(self, scale)</dt><dd><tt>Resample&nbsp;a&nbsp;sound<br>
&nbsp;<br>
scale&nbsp;=&nbsp;1.0&nbsp;means&nbsp;original&nbsp;sound<br>
scale&nbsp;=&nbsp;0.5&nbsp;is&nbsp;half&nbsp;as&nbsp;long&nbsp;(up&nbsp;an&nbsp;octave)<br>
scale&nbsp;=&nbsp;2.0&nbsp;is&nbsp;twice&nbsp;as&nbsp;long&nbsp;(down&nbsp;an&nbsp;octave)</tt></dd></dl>

<dl><dt><a name="Sound-scale"><strong>scale</strong></a>(self, vol)</dt><dd><tt>Scale&nbsp;a&nbsp;sound&nbsp;sample<br>
&nbsp;<br>
vol&nbsp;is&nbsp;0.0&nbsp;to&nbsp;1.0,&nbsp;amount&nbsp;to&nbsp;scale&nbsp;by</tt></dd></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="StreamingSound">class <strong>StreamingSound</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Represents&nbsp;a&nbsp;playable&nbsp;sound&nbsp;stream<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="StreamingSound-__init__"><strong>__init__</strong></a>(self, filename, checks<font color="#909090">=True</font>)</dt><dd><tt>Create&nbsp;new&nbsp;streaming&nbsp;sound&nbsp;from&nbsp;a&nbsp;WAV&nbsp;file&nbsp;or&nbsp;an&nbsp;MP3&nbsp;file<br>
&nbsp;<br>
The&nbsp;new&nbsp;streaming&nbsp;sound&nbsp;must&nbsp;match&nbsp;the&nbsp;output&nbsp;samplerate<br>
and&nbsp;stereo-ness.&nbsp;&nbsp;You&nbsp;can&nbsp;turn&nbsp;off&nbsp;these&nbsp;checks&nbsp;by&nbsp;setting<br>
the&nbsp;keyword&nbsp;checks=False,&nbsp;but&nbsp;the&nbsp;sound&nbsp;will&nbsp;be&nbsp;distorted.</tt></dd></dl>

<dl><dt><a name="StreamingSound-get_length"><strong>get_length</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;length&nbsp;of&nbsp;the&nbsp;sound&nbsp;stream&nbsp;in&nbsp;samples<br>
&nbsp;<br>
Only&nbsp;available&nbsp;for&nbsp;MP3&nbsp;streams,&nbsp;not&nbsp;WAV&nbsp;ones.&nbsp;&nbsp;To&nbsp;convert<br>
result&nbsp;to&nbsp;seconds,&nbsp;divide&nbsp;by&nbsp;the&nbsp;samplerate&nbsp;and&nbsp;then&nbsp;divide&nbsp;by<br>
2.</tt></dd></dl>

<dl><dt><a name="StreamingSound-play"><strong>play</strong></a>(self, volume<font color="#909090">=1.0</font>, offset<font color="#909090">=0</font>, fadein<font color="#909090">=0</font>, envelope<font color="#909090">=None</font>, loops<font color="#909090">=0</font>)</dt><dd><tt>Play&nbsp;the&nbsp;sound&nbsp;stream<br>
&nbsp;<br>
Keyword&nbsp;arguments:<br>
volume&nbsp;-&nbsp;volume&nbsp;to&nbsp;play&nbsp;sound&nbsp;at<br>
offset&nbsp;-&nbsp;sample&nbsp;to&nbsp;start&nbsp;playback<br>
fadein&nbsp;-&nbsp;number&nbsp;of&nbsp;samples&nbsp;to&nbsp;slowly&nbsp;fade&nbsp;in&nbsp;volume<br>
envelope&nbsp;-&nbsp;a&nbsp;list&nbsp;of&nbsp;[offset,&nbsp;volume]&nbsp;pairs&nbsp;defining<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;linear&nbsp;volume&nbsp;envelope<br>
loops&nbsp;-&nbsp;how&nbsp;many&nbsp;times&nbsp;to&nbsp;play&nbsp;the&nbsp;sound&nbsp;(-1&nbsp;is&nbsp;infinite)</tt></dd></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-calc_vol"><strong>calc_vol</strong></a>(t, env)</dt><dd><tt>Calculate&nbsp;volume&nbsp;at&nbsp;time&nbsp;t&nbsp;given&nbsp;envelope&nbsp;env<br>
&nbsp;<br>
envelope&nbsp;is&nbsp;a&nbsp;list&nbsp;of&nbsp;[time,&nbsp;volume]&nbsp;points<br>
time&nbsp;is&nbsp;measured&nbsp;in&nbsp;samples<br>
envelope&nbsp;should&nbsp;be&nbsp;sorted&nbsp;by&nbsp;time</tt></dd></dl>
 <dl><dt><a name="-get_microphone"><strong>get_microphone</strong></a>()</dt><dd><tt>Return&nbsp;raw&nbsp;data&nbsp;from&nbsp;microphone&nbsp;as&nbsp;Numpy&nbsp;array<br>
&nbsp;<br>
Default&nbsp;format&nbsp;will&nbsp;be&nbsp;16-bit&nbsp;signed&nbsp;mono.&nbsp;&nbsp;Format&nbsp;will&nbsp;match<br>
audio&nbsp;playback.&nbsp;&nbsp;You&nbsp;must&nbsp;call&nbsp;<a href="#-tick">tick</a>()&nbsp;every&nbsp;frame&nbsp;to&nbsp;update&nbsp;the<br>
results&nbsp;from&nbsp;this&nbsp;function.</tt></dd></dl>
 <dl><dt><a name="-init"><strong>init</strong></a>(samplerate<font color="#909090">=44100</font>, chunksize<font color="#909090">=1024</font>, stereo<font color="#909090">=True</font>, microphone<font color="#909090">=False</font>, input_device_index<font color="#909090">=None</font>, output_device_index<font color="#909090">=None</font>)</dt><dd><tt>Initialize&nbsp;mixer<br>
&nbsp;<br>
Must&nbsp;be&nbsp;called&nbsp;before&nbsp;any&nbsp;sounds&nbsp;can&nbsp;be&nbsp;played&nbsp;or&nbsp;loaded.<br>
&nbsp;<br>
Keyword&nbsp;arguments:<br>
samplerate&nbsp;-&nbsp;samplerate&nbsp;to&nbsp;use&nbsp;for&nbsp;playback&nbsp;(default&nbsp;22050)<br>
chunksize&nbsp;-&nbsp;size&nbsp;of&nbsp;playback&nbsp;chunks<br>
&nbsp;&nbsp;smaller&nbsp;is&nbsp;more&nbsp;responsive&nbsp;but&nbsp;perhaps&nbsp;stutters<br>
&nbsp;&nbsp;larger&nbsp;is&nbsp;more&nbsp;buffered,&nbsp;less&nbsp;stuttery&nbsp;but&nbsp;less&nbsp;responsive<br>
&nbsp;&nbsp;Can&nbsp;be&nbsp;any&nbsp;size,&nbsp;does&nbsp;not&nbsp;need&nbsp;to&nbsp;be&nbsp;a&nbsp;power&nbsp;of&nbsp;two.&nbsp;(default&nbsp;1024)<br>
stereo&nbsp;-&nbsp;whether&nbsp;to&nbsp;play&nbsp;back&nbsp;in&nbsp;stereo<br>
microphone&nbsp;-&nbsp;whether&nbsp;to&nbsp;enable&nbsp;microphone&nbsp;recording</tt></dd></dl>
 <dl><dt><a name="-interleave"><strong>interleave</strong></a>(left, right)</dt><dd><tt>Given&nbsp;two&nbsp;separate&nbsp;arrays,&nbsp;return&nbsp;a&nbsp;new&nbsp;interleaved&nbsp;array<br>
&nbsp;<br>
This&nbsp;function&nbsp;is&nbsp;useful&nbsp;for&nbsp;converting&nbsp;separate&nbsp;left/right&nbsp;audio<br>
streams&nbsp;into&nbsp;one&nbsp;stereo&nbsp;audio&nbsp;stream.&nbsp;&nbsp;Input&nbsp;arrays&nbsp;and&nbsp;returned<br>
array&nbsp;are&nbsp;Numpy&nbsp;arrays.<br>
&nbsp;<br>
See&nbsp;also:&nbsp;<a href="#-uninterleave">uninterleave</a>()</tt></dd></dl>
 <dl><dt><a name="-microphone_off"><strong>microphone_off</strong></a>()</dt><dd><tt>Turn&nbsp;off&nbsp;microphone</tt></dd></dl>
 <dl><dt><a name="-microphone_on"><strong>microphone_on</strong></a>()</dt><dd><tt>Turn&nbsp;on&nbsp;microphone<br>
&nbsp;<br>
Schedule&nbsp;audio&nbsp;input&nbsp;during&nbsp;main&nbsp;mixer&nbsp;tick.</tt></dd></dl>
 <dl><dt><a name="-quit"><strong>quit</strong></a>()</dt><dd><tt>Stop&nbsp;all&nbsp;playback&nbsp;and&nbsp;terminate&nbsp;mixer</tt></dd></dl>
 <dl><dt><a name="-resample"><strong>resample</strong></a>(smp, scale<font color="#909090">=1.0</font>)</dt><dd><tt>Resample&nbsp;a&nbsp;sound&nbsp;to&nbsp;be&nbsp;a&nbsp;different&nbsp;length<br>
&nbsp;<br>
Sample&nbsp;must&nbsp;be&nbsp;mono.&nbsp;&nbsp;May&nbsp;take&nbsp;some&nbsp;time&nbsp;for&nbsp;longer&nbsp;sounds<br>
sampled&nbsp;at&nbsp;44100&nbsp;Hz.<br>
&nbsp;<br>
Keyword&nbsp;arguments:<br>
scale&nbsp;-&nbsp;scale&nbsp;factor&nbsp;for&nbsp;length&nbsp;of&nbsp;sound&nbsp;(2.0&nbsp;means&nbsp;double&nbsp;length)</tt></dd></dl>
 <dl><dt><a name="-set_chunksize"><strong>set_chunksize</strong></a>(size<font color="#909090">=1024</font>)</dt><dd><tt>Set&nbsp;the&nbsp;audio&nbsp;chunk&nbsp;size&nbsp;for&nbsp;each&nbsp;frame&nbsp;of&nbsp;audio&nbsp;output<br>
&nbsp;<br>
This&nbsp;function&nbsp;is&nbsp;useful&nbsp;for&nbsp;setting&nbsp;the&nbsp;framerate&nbsp;when&nbsp;audio&nbsp;output<br>
is&nbsp;synchronized&nbsp;with&nbsp;video.</tt></dd></dl>
 <dl><dt><a name="-start"><strong>start</strong></a>()</dt><dd><tt>Start&nbsp;separate&nbsp;mixing&nbsp;thread</tt></dd></dl>
 <dl><dt><a name="-stereo_to_mono"><strong>stereo_to_mono</strong></a>(left, right)</dt><dd><tt>Return&nbsp;mono&nbsp;array&nbsp;from&nbsp;left&nbsp;and&nbsp;right&nbsp;sound&nbsp;stream&nbsp;arrays</tt></dd></dl>
 <dl><dt><a name="-tick"><strong>tick</strong></a>(extra<font color="#909090">=None</font>)</dt><dd><tt>Main&nbsp;loop&nbsp;of&nbsp;mixer,&nbsp;mix&nbsp;and&nbsp;do&nbsp;audio&nbsp;IO<br>
&nbsp;<br>
Audio&nbsp;sources&nbsp;are&nbsp;mixed&nbsp;by&nbsp;addition&nbsp;and&nbsp;then&nbsp;clipped.&nbsp;&nbsp;Too&nbsp;many<br>
loud&nbsp;sources&nbsp;will&nbsp;cause&nbsp;distortion.<br>
&nbsp;<br>
extra&nbsp;is&nbsp;for&nbsp;extra&nbsp;sound&nbsp;data&nbsp;to&nbsp;mix&nbsp;into&nbsp;output<br>
&nbsp;&nbsp;must&nbsp;be&nbsp;in&nbsp;numpy&nbsp;array&nbsp;of&nbsp;correct&nbsp;length</tt></dd></dl>
 <dl><dt><a name="-uninterleave"><strong>uninterleave</strong></a>(data)</dt><dd><tt>Given&nbsp;a&nbsp;stereo&nbsp;array,&nbsp;return&nbsp;separate&nbsp;left&nbsp;and&nbsp;right&nbsp;streams<br>
&nbsp;<br>
This&nbsp;function&nbsp;converts&nbsp;one&nbsp;array&nbsp;representing&nbsp;interleaved&nbsp;left&nbsp;and<br>
right&nbsp;audio&nbsp;streams&nbsp;into&nbsp;separate&nbsp;left&nbsp;and&nbsp;right&nbsp;arrays.&nbsp;&nbsp;The&nbsp;return<br>
value&nbsp;is&nbsp;a&nbsp;list&nbsp;of&nbsp;length&nbsp;two.&nbsp;&nbsp;Input&nbsp;array&nbsp;and&nbsp;output&nbsp;arrays&nbsp;are&nbsp;all<br>
Numpy&nbsp;arrays.<br>
&nbsp;<br>
See&nbsp;also:&nbsp;<a href="#-interleave">interleave</a>()</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>gchannels</strong> = 1<br>
<strong>gchunksize</strong> = 1024<br>
<strong>gid</strong> = 1<br>
<strong>ginit</strong> = False<br>
<strong>ginput_device_index</strong> = None<br>
<strong>glock</strong> = &lt;thread.lock object at 0xb7d540b0&gt;<br>
<strong>gmic</strong> = False<br>
<strong>gmicdata</strong> = None<br>
<strong>gmicstream</strong> = None<br>
<strong>gmixer_srcs</strong> = []<br>
<strong>goutput_device_index</strong> = None<br>
<strong>gpyaudio</strong> = None<br>
<strong>gsamplerate</strong> = 44100<br>
<strong>gsamplewidth</strong> = 2<br>
<strong>gstereo</strong> = True<br>
<strong>gstream</strong> = None</td></tr></table>
</body></html>